{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## ch05"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Audi\n",
      "BMW\n",
      "Subaru\n",
      "Toyota\n",
      "True\n",
      "False\n",
      "False\n",
      "True\n",
      "Audi\n",
      "Hold the anchovies\n",
      "True\n",
      "That is not correct answer. Please try again!\n",
      "True True False True True\n",
      "False\n",
      "True\n",
      "True\n",
      "True\n",
      "No, I cannot find this\n",
      "You are old enough to vote!\n",
      "Have you registered to vote yet?\n",
      "Your admission cost is $5.\n",
      "\n",
      "简化版\n",
      "Your admission cost is $5.\n",
      "\n",
      "多个elif\n",
      "Your admission cost is $10.\n",
      "\n",
      "都用elif，不用else的情况：\n",
      "Your admission cost is $10.\n",
      "Adding mushrooms.\n",
      "Adding green peppers.\n",
      "Adding extra cheese.\n",
      "\n",
      "Finished making your pizza!\n",
      "Adding mushrooms.\n",
      "Sorry, we are out of green peppers right now.\n",
      "Adding green peppers.\n",
      "Adding extra cheese.\n",
      "\n",
      "Finished making your pizza!\n",
      "Are you sure you want a plain pizza?\n",
      "Adding mushrooms.\n",
      "Sorry we donnot have french fries.\n",
      "Adding extra cheese.\n",
      "\n",
      "Finished making your pizza!\n",
      "Is wo == 'hao kan'? I predict True.\n",
      "True\n",
      "\n",
      "Is wo == 'yi ban hao kan'? I predict False.\n",
      "False\n",
      "\n",
      "string_1==string_2:\n",
      "True\n",
      "\n",
      "string_1==string_3:\n",
      "False\n",
      "\n",
      "string_1.lower()==string_3.lower():\n",
      "True\n",
      "\n",
      "age_julaosi==age_beilaosi:\n",
      "False\n",
      "\n",
      "age_julaosi!=age_beilaosi:\n",
      "True\n",
      "\n",
      "age_julaosi>age_beilaosi:\n",
      "True\n",
      "\n",
      "age_julaosi<age_beilaosi:\n",
      "False\n",
      "\n",
      "age_julaosi>=age_beilaosi:\n",
      "True\n",
      "\n",
      "age_julaosi<=age_beilaosi:\n",
      "False\n",
      "\n",
      "False and Ture:\n",
      "False\n",
      "\n",
      "False or Ture:\n",
      "True\n",
      "\n",
      "Is 'mianmian' in zyL48?\n",
      "True\n",
      "\n",
      "Is 'maohou' in zyL48?\n",
      "False\n",
      "\n",
      "Is 'mianmian' not in zyL48?\n",
      "False\n",
      "\n",
      "Is 'maohou' not in zyL48?\n",
      "True\n",
      "\n",
      "三体监听员：不要回答不要回答\n",
      "叶文洁没有回答，于是\n",
      "全局终\n",
      "\n",
      "三体监听员：不要回答不要回答\n",
      "叶文洁回答了，于是\n",
      "坏菜了\n",
      "\n",
      "叶文洁：如果思想可以直接显示在头顶，三体人的头有颜色吗？\n",
      "三体人：各种颜色都有\n",
      "叶文洁：你是什么颜色？\n",
      "三体监听员：绿色。\n",
      "叶文洁：你这个颜色在我们地球很不吉利啊。\n",
      "三体监听员：。。。\n",
      "\n",
      "叶文洁：如果思想可以直接显示在头顶，三体人的头有颜色吗？\n",
      "三体人：各种颜色都有\n",
      "叶文洁：你是什么颜色？\n",
      "三体监听员：平时没有颜色，近乎半透明，只有思考的时候会显出黄色波纹。\n",
      "叶文洁：你这个思想在我们地球估计不能过审啊。\n",
      "三体监听员：。。。\n",
      "\n",
      "Naruto继续当火影，工作养家\n",
      "您真有品味！！\n",
      "惊为天人，求你跟我做朋友\n",
      "卢梭 Rousseau 你说的挺好\n",
      "弗洛伊德 Freud 你说的挺好\n",
      "海德格尔 Heidegger 你说的挺好\n",
      "叔本华 Schopenhauer 你说的挺好\n",
      "马克思 Marx 你说的挺好\n",
      "666 666\n",
      "ROUSSEAU,请不要重复报名！\n",
      "Freud,请不要重复报名！\n",
      "Thoreau,恭喜注册成功！\n",
      "Leibniz,恭喜注册成功！\n",
      "Dostoevsky,恭喜注册成功！\n"
     ]
    },
    {
     "ename": "TypeError",
     "evalue": "unsupported operand type(s) for +: 'int' and 'str'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-1-77a6dd04b1ae>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[0;32m    450\u001b[0m \u001b[1;32mfor\u001b[0m \u001b[0mnumber\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mnumbers\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    451\u001b[0m     \u001b[1;32mif\u001b[0m \u001b[0mnumber\u001b[0m\u001b[1;33m==\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 452\u001b[1;33m         \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mnumber\u001b[0m\u001b[1;33m+\u001b[0m\u001b[1;34m'st'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    453\u001b[0m     \u001b[1;32melif\u001b[0m \u001b[0mnumber\u001b[0m\u001b[1;33m==\u001b[0m\u001b[1;36m2\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    454\u001b[0m         \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mnumber\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m__str__\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m+\u001b[0m\u001b[1;34m'nd'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mTypeError\u001b[0m: unsupported operand type(s) for +: 'int' and 'str'"
     ]
    }
   ],
   "source": [
    "cars=['audi','bmw','subaru','toyota']\n",
    "\n",
    "for car in cars:\n",
    "    if car=='bmw':\n",
    "        print(car.upper())\n",
    "    else:\n",
    "        print(car.title())\n",
    "\n",
    "#==的含义，条件测试，检查是否等于，而不是赋值\n",
    "\n",
    "car='bmw'\n",
    "a=car=='bmw'\n",
    "print(a)\n",
    "b=car=='audi'\n",
    "print(b)\n",
    "c=car=='Bmw'#区分大小写\n",
    "print(c)\n",
    "\n",
    "#当不想区分大小写时，都转换为小写\n",
    "car='Audi'\n",
    "d=car.lower()=='audi'\n",
    "print(d)\n",
    "print(car)#原来的car没有被改变\n",
    "\n",
    "#if不等于\n",
    "requested_topping='mushrooms'\n",
    "\n",
    "if requested_topping != 'anchovies':\n",
    "    print(\"Hold the anchovies\")\n",
    "\n",
    "#对数字的判断\n",
    "age=18\n",
    "g=age==18\n",
    "print(g)\n",
    "\n",
    "answer=17\n",
    "if answer != 42:\n",
    "    print('That is not correct answer. Please try again!')\n",
    "# 对数字判断的特有符号\n",
    "age=18\n",
    "h=age==18\n",
    "i=age<19\n",
    "j=age>21\n",
    "k=age>=18\n",
    "l=age<=19\n",
    "print(h,i,j,k,l)\n",
    "\n",
    "#且，或\n",
    "age_0=22\n",
    "age_1=18\n",
    "\n",
    "print(age_0>=21 and age_1>=21)\n",
    "print(age_0>=21 or age_1>=21)\n",
    "\n",
    "#是否存在于列表\n",
    "\n",
    "a=[1,2,3,4,5]\n",
    "print(1 in a)\n",
    "print(2 in a)\n",
    "\n",
    "#是否不在\n",
    "a=[2,3,4,5,6]\n",
    "if 1 not in a:\n",
    "    print('No, I cannot find this')\n",
    "\n",
    "#if语句，else，投票的例子\n",
    "age=19\n",
    "if age>=18:\n",
    "    print('You are old enough to vote!')\n",
    "    print(\"Have you registered to vote yet?\")\n",
    "else:\n",
    "    print(\"Sorry, you are too young to vote.\")\n",
    "    print(\"Please register to vote as soon as you turn 18!\")\n",
    "\n",
    "# 门票的判断\n",
    "age=12\n",
    "if age<=4:\n",
    "    print(\"Your admission cost is $0.\")\n",
    "elif age<18:\n",
    "    print(\"Your admission cost is $5.\")\n",
    "else:\n",
    "    print(\"Your admission cost is $10.\")\n",
    "\n",
    "# 简化版，price提出来\n",
    "print(\"\\n简化版\")\n",
    "age=12\n",
    "if age<4:\n",
    "    price=0\n",
    "elif age<18:\n",
    "    price=5\n",
    "else:\n",
    "    price=10\n",
    "\n",
    "print(\"Your admission cost is $\"+str(price)+\".\")\n",
    "\n",
    "#如果上一个为真，之后elif不会执行,elif=else if\n",
    "print(\"\\n多个elif\")\n",
    "age=60\n",
    "if age<4:\n",
    "    price=0\n",
    "elif age<18:\n",
    "    price=5\n",
    "elif age<65:\n",
    "    price=10\n",
    "else:\n",
    "    price=5\n",
    "\n",
    "print(\"Your admission cost is $\"+str(price)+\".\")\n",
    "\n",
    "#省略else\n",
    "print(\"\\n都用elif，不用else的情况：\")\n",
    "age=60\n",
    "if age<4:\n",
    "    price=0\n",
    "elif age<18:\n",
    "    price=5\n",
    "elif age<65:\n",
    "    price=10\n",
    "elif age>=65:\n",
    "    price=5\n",
    "print(\"Your admission cost is $\"+str(price)+\".\")\n",
    "\n",
    "#检查元素\n",
    "requested_toppings=['mushrooms','green peppers','extra cheese']\n",
    "for requested_topping in requested_toppings:\n",
    "    print(\"Adding \"+requested_topping+'.')\n",
    "print('\\nFinished making your pizza!')\n",
    "\n",
    "#for+if，没有青椒了\n",
    "requested_toppings=['mushrooms','green peppers','extra cheese']\n",
    "for requested_topping in requested_toppings:\n",
    "    if requested_topping=='green peppers':\n",
    "        print(\"Sorry, we are out of green peppers right now.\")\n",
    "    eles:\\\n",
    "        print(\"Adding \"+requested_topping+'.')\n",
    "print('\\nFinished making your pizza!')\n",
    "\n",
    "#没点额外配料，列表为空时，判断值默认为false\n",
    "requested_toppings=[]\n",
    "if requested_toppings:#列表不是空的时候\n",
    "    for requested_topping in requested_toppings:\n",
    "        if requested_topping == 'green peppers':\n",
    "            print(\"Sorry, we are out of green peppers right now.\")\n",
    "        eles: \\\n",
    "            print(\"Adding \" + requested_topping + '.')\n",
    "    print('\\nFinished making your pizza!')\n",
    "else:\n",
    "    print(\"Are you sure you want a plain pizza?\")\n",
    "\n",
    "#多个列表\n",
    "availabale_toppings=['mushrooms','olives','green peppers','pepperoni','pineapple','extra cheese']\n",
    "requested_toppings=['mushrooms','french fries','extra cheese']\n",
    "\n",
    "for requested_topping in requested_toppings:\n",
    "    if requested_topping in availabale_toppings:\n",
    "        print(\"Adding \"+requested_topping+'.')\n",
    "    else:\n",
    "        print('Sorry we donnot have '+requested_topping+'.')\n",
    "print(\"\\nFinished making your pizza!\")\n",
    "\n",
    "# 习题 5-1 条件测试，预期+答案\n",
    "\n",
    "wo='hao kan'\n",
    "print(\"Is wo == 'hao kan'? I predict True.\")\n",
    "print(wo == 'hao kan')\n",
    "print(\"\\nIs wo == 'yi ban hao kan'? I predict False.\")\n",
    "print(wo == 'yi ban hao kan')\n",
    "\n",
    "# 5-2 更多条件测试，每个都来一个ture，来一个false\n",
    "\n",
    "# 字符串\n",
    "string_1='Big mama'\n",
    "string_2='Big mama'\n",
    "string_3='Big Mama'\n",
    "\n",
    "print('\\nstring_1==string_2:')\n",
    "print(string_1==string_2)\n",
    "\n",
    "print('\\nstring_1==string_3:')\n",
    "print(string_1==string_3)\n",
    "\n",
    "# 使用函数lower()的测试\n",
    "print('\\nstring_1.lower()==string_3.lower():')\n",
    "print(string_1.lower()==string_3.lower())\n",
    "\n",
    "# 检查两个数字\n",
    "\n",
    "age_julaosi=31\n",
    "age_beilaosi=29\n",
    "\n",
    "print('\\nage_julaosi==age_beilaosi:')\n",
    "print(age_julaosi==age_beilaosi)\n",
    "\n",
    "print('\\nage_julaosi!=age_beilaosi:')\n",
    "print(age_julaosi!=age_beilaosi)\n",
    "\n",
    "print('\\nage_julaosi>age_beilaosi:')\n",
    "print(age_julaosi>age_beilaosi)\n",
    "\n",
    "print('\\nage_julaosi<age_beilaosi:')\n",
    "print(age_julaosi<age_beilaosi)\n",
    "\n",
    "print('\\nage_julaosi>=age_beilaosi:')\n",
    "print(age_julaosi>=age_beilaosi)\n",
    "\n",
    "print('\\nage_julaosi<=age_beilaosi:')\n",
    "print(age_julaosi<=age_beilaosi)\n",
    "\n",
    "# and or\n",
    "print('\\nFalse and Ture:')\n",
    "print(age_julaosi==age_beilaosi and age_julaosi!=age_beilaosi)\n",
    "\n",
    "print('\\nFalse or Ture:')\n",
    "print(age_julaosi==age_beilaosi or age_julaosi!=age_beilaosi)\n",
    "\n",
    "# 测试特定值是否包含在列表当中\n",
    "zyL48=['weiwei','mianmian','xiaoxue','shengge','kaixin']\n",
    "# 不允许使用小写的L，命名规则，在有些编译器中小写的L与数字1分不清楚\n",
    "\n",
    "print(\"\\nIs 'mianmian' in zyL48?\")\n",
    "print('mianmian' in zyL48)\n",
    "\n",
    "print(\"\\nIs 'maohou' in zyL48?\")\n",
    "print('maohou' in zyL48)\n",
    "\n",
    "# 测试特定的值是否未包含在列表中\n",
    "\n",
    "print(\"\\nIs 'mianmian' not in zyL48?\")\n",
    "print('mianmian' not in zyL48)\n",
    "\n",
    "print(\"\\nIs 'maohou' not in zyL48?\")\n",
    "print('maohou' not in zyL48)\n",
    "\n",
    "# 5-3 外星人颜色 if\n",
    "\n",
    "print('\\n三体监听员：不要回答不要回答')\n",
    "\n",
    "yewenjie='没回答'\n",
    "if yewenjie == '没回答':\n",
    "    print('叶文洁没有回答，于是')\n",
    "    print('全局终')\n",
    "\n",
    "print('\\n三体监听员：不要回答不要回答')\n",
    "yewenjie='回答'\n",
    "if yewenjie == '没回答':\n",
    "    print('叶文洁没有回答，于是')\n",
    "    print('全局终')\n",
    "\n",
    "if yewenjie=='回答':\n",
    "    print('叶文洁回答了，于是')\n",
    "    print('坏菜了')\n",
    "\n",
    "\n",
    "\n",
    "# 5-4 if else\n",
    "\n",
    "## 测试通过\n",
    "print('\\n叶文洁：如果思想可以直接显示在头顶，三体人的头有颜色吗？')\n",
    "print('三体人：各种颜色都有')\n",
    "print('叶文洁：你是什么颜色？')\n",
    "trisolaran_color='green'\n",
    "\n",
    "if trisolaran_color=='green':\n",
    "    print('三体监听员：绿色。')\n",
    "    print('叶文洁：你这个颜色在我们地球很不吉利啊。')\n",
    "    print('三体监听员：。。。')\n",
    "else:\n",
    "    print('三体监听员：平时没有颜色，近乎半透明，只有思考的时候会显出黄色波纹。\\n')\n",
    "    print('叶文洁：你这个思想在我们地球估计不能过审啊。')\n",
    "    print('三体监听员：。。。')\n",
    "\n",
    "## 测试未通过\n",
    "print('\\n叶文洁：如果思想可以直接显示在头顶，三体人的头有颜色吗？')\n",
    "print('三体人：各种颜色都有')\n",
    "print('叶文洁：你是什么颜色？')\n",
    "trisolaran_color='yellow'\n",
    "if trisolaran_color=='green':\n",
    "    print('三体监听员：绿色。')\n",
    "    print('叶文洁：你这个颜色在我们地球很不吉利啊。')\n",
    "    print('三体监听员：。。。')\n",
    "else:\n",
    "    print('三体监听员：平时没有颜色，近乎半透明，只有思考的时候会显出黄色波纹。')\n",
    "    print('叶文洁：你这个思想在我们地球估计不能过审啊。')\n",
    "    print('三体监听员：。。。')\n",
    "\n",
    "# 习题 5-5 外星人颜色 无聊，我改成了路飞打怪升级的例子\n",
    "# 路飞打败相应的敌人，悬赏金就有相应的提升\n",
    "\n",
    "boss='?'\n",
    "if boss=='恶霸-阿龙':\n",
    "    print('| ~~ WANTED ~~ |')\n",
    "    print('|              |')\n",
    "    print('|              |')\n",
    "    print('|              |')\n",
    "    print('|              |')\n",
    "    print('|              |')\n",
    "    print('|DIED OR  ALIVE|')\n",
    "    print('|MONKEY D LUFFY|')\n",
    "    print('| B 30 000 000 |')\n",
    "    print('|     ---Marine|')\n",
    "\n",
    "elif boss=='七武海-老沙':\n",
    "    print('| ~~ WANTED ~~ |')\n",
    "    print('|              |')\n",
    "    print('|              |')\n",
    "    print('|              |')\n",
    "    print('|              |')\n",
    "    print('|              |')\n",
    "    print('|DIED OR  ALIVE|')\n",
    "    print('|MONKEY D LUFFY|')\n",
    "    print('|B 100 000 000 |')\n",
    "    print('|     ---Marine|')\n",
    "\n",
    "elif boss=='CP9-路奇':\n",
    "    print('| ~~ WANTED ~~ |')\n",
    "    print('|              |')\n",
    "    print('|              |')\n",
    "    print('|              |')\n",
    "    print('|              |')\n",
    "    print('|              |')\n",
    "    print('|DIED OR  ALIVE|')\n",
    "    print('|MONKEY D LUFFY|')\n",
    "    print('|B 300 000 000 |')\n",
    "    print('|     ---Marine|')\n",
    "\n",
    "elif boss=='大事件-救艾斯':\n",
    "    print('| ~~ WANTED ~~ |')\n",
    "    print('|              |')\n",
    "    print('|              |')\n",
    "    print('|              |')\n",
    "    print('|              |')\n",
    "    print('|              |')\n",
    "    print('|DIED OR  ALIVE|')\n",
    "    print('|MONKEY D LUFFY|')\n",
    "    print('|B 400 000 000 |')\n",
    "    print('|     ---Marine|')\n",
    "\n",
    "elif boss=='七武海-多弗朗明哥':\n",
    "    print('| ~~ WANTED ~~ |')\n",
    "    print('|              |')\n",
    "    print('|              |')\n",
    "    print('|              |')\n",
    "    print('|              |')\n",
    "    print('|              |')\n",
    "    print('|DIED OR  ALIVE|')\n",
    "    print('|MONKEY D LUFFY|')\n",
    "    print('|B 500 000 000 |')\n",
    "    print('|     ---Marine|')\n",
    "\n",
    "elif boss=='七武海-多弗朗明哥':\n",
    "    print('| ~~ WANTED ~~ |')\n",
    "    print('|              |')\n",
    "    print('|              |')\n",
    "    print('|              |')\n",
    "    print('|              |')\n",
    "    print('|              |')\n",
    "    print('|DIED OR  ALIVE|')\n",
    "    print('|MONKEY D LUFFY|')\n",
    "    print('|B 500 000 000 |')\n",
    "    print('|     ---Marine|')\n",
    "\n",
    "elif boss=='BigMama-塔塔库力':\n",
    "    print('| ~~ WANTED ~~ |')\n",
    "    print('|              |')\n",
    "    print('|              |')\n",
    "    print('|              |')\n",
    "    print('|              |')\n",
    "    print('|              |')\n",
    "    print('|DIED OR  ALIVE|')\n",
    "    print('|MONKEY D LUFFY|')\n",
    "    print('|B 1500 000 000|')\n",
    "    print('|     ---Marine|')\n",
    "\n",
    "# 习题5-6 人生的不同阶段\n",
    "age_naruto=60\n",
    "\n",
    "if age_naruto==0:\n",
    "    print('\\nNaruto刚出生时，正值九尾之战，水门夫妇牺牲，九尾被封印在Naruto体内')\n",
    "if age_naruto>0 and age_naruto<12:\n",
    "    print('\\n幼年Naruto在孤独中成长，到处捣乱以引起注意')\n",
    "if age_naruto>=12 and age_naruto<13:\n",
    "    print('\\nNaruto成为下忍')\n",
    "if age_naruto>=13 and age_naruto<17:\n",
    "    print('\\nNaruto晋升中忍')\n",
    "if age_naruto>=17 and age_naruto<23:\n",
    "    print('\\nNaruto晋升上忍')\n",
    "if age_naruto>=23 and age_naruto<30:\n",
    "    print('\\nNaruto成为火影，结婚生娃')\n",
    "if age_naruto>=30 and age_naruto<65:\n",
    "    print('\\nNaruto继续当火影，工作养家')\n",
    "if age_naruto>=65:\n",
    "    print('\\nNaruto退休养老，不过也有可能像三代一样，干到满脸褶')\n",
    "\n",
    "# 习题5-7 喜欢的水果\n",
    "favorite_fruits=['durian','small durian','big durian','huge durian']\n",
    "\n",
    "if 'small durian' in favorite_fruits:\n",
    "    print('您真有品味！！')\n",
    "\n",
    "if 'banana' in favorite_fruits:\n",
    "    print('您真有品味！！')\n",
    "\n",
    "\n",
    "if 'apple' in favorite_fruits:\n",
    "    print('您真有品味！！')\n",
    "\n",
    "if 'huge durian' in favorite_fruits:\n",
    "    print('惊为天人，求你跟我做朋友')\n",
    "\n",
    "\n",
    "# 习题 5-8，特殊对待\n",
    "names=['卢梭 Rousseau','弗洛伊德 Freud','海德格尔 Heidegger','叔本华 Schopenhauer','马克思 Marx']\n",
    "\n",
    "for name in names:\n",
    "    print(name+' 你说的挺好')\n",
    "    if name == '马克思 Marx':\n",
    "        print('666 666')\n",
    "\n",
    "#习题 5-9\n",
    "\n",
    "names=[]\n",
    "if not names:\n",
    "    for name in names:\n",
    "        print(name+' 你说的挺好')\n",
    "        if name == '马克思 Marx':\n",
    "            print('666 666')\n",
    "else:\n",
    "    print('We need to find some users！')\n",
    "\n",
    "# 习题5-10 检查用户名\n",
    "current_users=['Rousseau','Freud','Heidegger','Schopenhauer','Marx']\n",
    "new_users=['ROUSSEAU','Freud','Thoreau','Leibniz','Dostoevsky']\n",
    "current_users_lower=[]\n",
    "\n",
    "# 转换为小写原始名单全部\n",
    "for current_user in current_users:\n",
    "    name_lower=current_user.lower()\n",
    "    current_users_lower.append(name_lower)\n",
    "\n",
    "# 检查新旧名单是否重复，统一成小写\n",
    "for new_user in new_users:\n",
    "    if new_user.lower() in current_users_lower:\n",
    "        print(new_user+',请不要重复报名！')\n",
    "    else:\n",
    "        print(new_user+',恭喜注册成功！')\n",
    "\n",
    "# 习题5-11 1-9\n",
    "\n",
    "numbers=range(1,10)\n",
    "for number in numbers:\n",
    "    if number==1:\n",
    "        print(number+'st')\n",
    "    elif number==2:\n",
    "        print(number.__str__()+'nd')\n",
    "    elif number==3:\n",
    "        print(number.__str__()+'rd')\n",
    "    else:\n",
    "        print(number.__str__()+'th')\n",
    "\n",
    "# 习题 5-12 检查 正确 不说了，不正确也运行不出来啊\n",
    "# 习题 5-13 我又膨胀了，让我设想\n",
    "\n",
    "# 1 想编写的游戏：\n",
    "# 原理：有一定定数，又有一定变数，定数越少，变数越多这个游戏质量越高\n",
    "\n",
    "# 想做一个商业类模拟游戏，把所有商业基本理念抽象出来结合到里面，有点像大学里面做的企业模拟，但更复杂\n",
    "# 我发现很多人对企业的认知很有限，居然还有人跟我说学注会学管理没有用\n",
    "# 反正我自己学完会计啥的，感觉整个人对企业的认知都变了，会发现自己有很多的直观的错误的理念\n",
    "# 从最简单的商业模式开始，一步一步升级\n",
    "#\n",
    "# 创始人，投资人，合作形式，股权财务法务，项目，产品，市场，竞争，企业周期，后期维护，内部管理，内部审计等等\n",
    "# 继承，合并分立破产解散清算啥的\n",
    "\n",
    "# 名字就叫做，企业的一生\n",
    "# 我相信这个游戏会有市场，为什么，最有市场的产品是什么：帮人赚钱的产品\n",
    "\n",
    "\n",
    "# 2 想研究的数据集 这个数据现在可能还没有\n",
    "\n",
    "# 如果实现线上教育，对学生学习进行全纪录的话，\n",
    "# 如对考试做一个全纪录的话，分析出哪里容易错，哪里难，老师重点就讲哪里\n",
    "# 如对学习者的行为做全纪录的话，就可以分析出他学习的特点，他精力集中的时间等\n",
    "# 分析他的特质，发掘他的潜能，安排适合他的学习安排\n",
    "\n",
    "# 3 Web 我现在就不懂为啥没有一个专门用来学习的app哈哈\n",
    "# 视频音频评论笔记群文件书课程习题资源各种多维交流的那种\n",
    "# 不过能有b站我已经感觉很幸 福了，淘宝 b站 美食简直人生三大支柱\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
